home *** CD-ROM | disk | FTP | other *** search
/ Especial Multimedia / Especial Multimedia.iso / Multimed / Herra / TIMWIN.ZIP / SWITCH1.CMD < prev    next >
OS/2 REXX Batch file  |  1993-09-22  |  2KB  |  100 lines

  1. ;switch1   --  tests switches on strip
  2. ;              2nd version: extracts switch to be investigated from
  3. ;              the other parts
  4. ;*****************************************************
  5. #include timdefs.h
  6.  
  7. parms
  8.   int windis
  9. endparms
  10. int tlr
  11. int aant
  12. int pos1
  13. int pos2
  14. int xfrm
  15. int yfrm
  16. int ok
  17. int pat
  18. int err
  19.  
  20. cls
  21. print "Learning phase ..."
  22. era p
  23. era q
  24. dest r
  25. thre r 1
  26. ;err = chk lut 2 4
  27. *selut 4
  28. *windispl h (windis+NO_DITHER+WINLUT4)
  29. dest s
  30. thre s 1
  31. *windispl i (windis+NO_DITHER)
  32. tlr = 8
  33. while tlr > 0
  34.   dest p
  35.   bit a tlr
  36.   bord 1
  37.   aant = label
  38.   dest q
  39.   era q
  40.   mark p 2
  41.   pos1 = curs
  42.   mark p aant
  43.   pos2 = curs
  44.   drln pos1 pos2 255
  45.   mark p 3
  46. ;pos1 = curs
  47. ;drln pos1 pos2 255
  48.   mark q 255
  49.   aant = frmt         ;reduce format
  50.   xfrm = (aant & 255) - 2
  51.   yfrm = ((aant >> 16) & 255) - 2
  52.   frmt yfrm xfrm
  53.   era
  54.   curs p q   ; p
  55.   copy pc qc
  56.   bord qc 1
  57.   aant = label
  58.   if tlr == 8              ;first device
  59.     ok = aant              ;learn value
  60.     print @8 "  ... Known good device has", aant, "holes" 
  61.     scroll
  62.     print ""
  63.     print "   Image         # holes       Result"
  64.     pat = 2
  65.   else
  66.     if aant == ok
  67.       print @5 (9-tlr), @20 aant, @35 " OK"
  68.       pat = 2
  69.     else
  70.       print @5 (9-tlr), @20 aant, @32 " ERROR"
  71.       pat = 1
  72.     endif
  73.   endif
  74.   if tlr > 6
  75.     dest r
  76.     if tlr == 8 and r1 pat
  77.     if tlr == 7 and r2 pat
  78.     *windispl h (windis+NO_DITHER)
  79.   elseif tlr > 4
  80.     dest s
  81.     if tlr == 6 and s1 pat
  82.     if tlr == 5 and s2 pat
  83.     *windispl i (windis+NO_DITHER)
  84.   elseif tlr > 2
  85.     dest r
  86.     if tlr == 4 and r3 pat
  87.     if tlr == 3 and r4 pat
  88.     *windispl h (windis+NO_DITHER)
  89.   else
  90.     dest s
  91.     if tlr == 2 and s3 pat
  92.     if tlr == 1 and s4 pat
  93.     *windispl i (windis+NO_DITHER)
  94.   endif
  95.   tlr -= 1
  96. endw
  97.  
  98. stop
  99. 
  100.